package com.celtic.webapp.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.celtic.model.Project;
import com.celtic.service.ProjectManager;

@Controller
@RequestMapping("/projects")
public class ProjectController  extends BaseFormController {
	@Autowired
	private ProjectManager projectManager;
	

	
	
	@RequestMapping(method = RequestMethod.GET)
    public ModelAndView handleRequest()  throws Exception {
		log.fatal("==> before handle request in project controller 	");
		List<Project> projectsList = projectManager.getAllDistinct();
		log.fatal(projectsList.toString());
		return new ModelAndView().addObject("projectsList",projectsList);
    }
	
}
